<template>
  <div>
    <el-row>
      <el-col :span="6" v-for="(iterm, index) in alldata"
        ><div class="box" @click="Network(index)">{{ iterm }}</div></el-col
      >
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      allindex: [],
      alldata: [],
    };
  },
  methods: {
    Network(index) {
      this.$router.push({ path: `/caidan?id=${this.allindex[index]}` });
    },
    content1(res) {
      let arr = [];
      let arr1 = [];
      res.data.forEach((el) => {
        if (el.content == "类") {
        } else {
          arr.push(el.content);
        }
      });
      this.alldata = arr;
      res.data.forEach((el) => {
        if (el.content == "类") {
        } else {
         
          arr1.push(el.id);
        }
      });
      this.allindex = arr1;
    },
  },
  props: {
    mydata1: {
      type: String | undefined,
      required: true,
    },
  },
  mounted() {
    this.$axios({
      url: "http://localhost:8081/zhh/caipufenleidata",
      params: {
        titleData: this.mydata1,
      },
    }).then((res) => {
      this.content1(res);
    });
  },
};
</script>

<style scoped>
.box {
  cursor: pointer;
  margin-top: 10px;
  font-size: 15px;
}
.box:hover {
  color: #dd3915;
}
</style>